{% extends 'custom_admin/base.html' %}

{% block title %}管理后台 - 首页{% endblock %}

{% block content %}
<div class="page-heading">
    <h4><i class="fas fa-tachometer-alt me-2"></i>首页</h4>
</div>

<div class="row g-4 mb-4">
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-primary">
            <div class="card-body text-center">
                <h5 class="card-title">文章总数</h5>
                <h2 class="mb-0">{{ article_count }}</h2>
                <i class="fas fa-file-alt fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-success">
            <div class="card-body text-center">
                <h5 class="card-title">已发布</h5>
                <h2 class="mb-0">{{ published_count }}</h2>
                <i class="fas fa-check-circle fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-warning">
            <div class="card-body text-center">
                <h5 class="card-title">待审核</h5>
                <h2 class="mb-0">{{ pending_count }}</h2>
                <i class="fas fa-clock fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-info">
            <div class="card-body text-center">
                <h5 class="card-title">一审通过</h5>
                <h2 class="mb-0">{{ first_approved_count }}</h2>
                <i class="fas fa-thumbs-up fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
</div>

<div class="row g-4 mb-4">
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-secondary">
            <div class="card-body text-center">
                <h5 class="card-title">分类总数</h5>
                <h2 class="mb-0">{{ category_count }}</h2>
                <i class="fas fa-list fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-dark">
            <div class="card-body text-center">
                <h5 class="card-title">部门总数</h5>
                <h2 class="mb-0">{{ department_count }}</h2>
                <i class="fas fa-building fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-danger">
            <div class="card-body text-center">
                <h5 class="card-title">用户组</h5>
                <h2 class="mb-0">{{ user_group_count }}</h2>
                <i class="fas fa-users fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="stat-card bg-info">
            <div class="card-body text-center">
                <h5 class="card-title">权限组</h5>
                <h2 class="mb-0">{{ permission_group_count }}</h2>
                <i class="fas fa-user-lock fa-2x opacity-50"></i>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0"><i class="fas fa-bolt me-2"></i>快捷操作</h5>
            </div>
            <div class="card-body">
                <div class="action-buttons">
                    <a href="{% url 'custom_admin:article_list' %}" class="btn btn-primary">
                        <i class="fas fa-file-alt me-1"></i>文章管理
                    </a>
                    <a href="{% url 'custom_admin:article_create' %}" class="btn btn-success">
                        <i class="fas fa-plus me-1"></i>创建文章
                    </a>
                    <a href="{% url 'custom_admin:category_list' %}" class="btn btn-secondary">
                        <i class="fas fa-list me-1"></i>分类管理
                    </a>
                    <a href="{% url 'custom_admin:department_list' %}" class="btn btn-secondary">
                        <i class="fas fa-building me-1"></i>部门管理
                    </a>
                    <a href="{% url 'custom_admin:user_group_list' %}" class="btn btn-secondary">
                        <i class="fas fa-users me-1"></i>用户组管理
                    </a>
                    <a href="{% url 'custom_admin:permission_group_list' %}" class="btn btn-secondary">
                        <i class="fas fa-users-cog me-1"></i>权限组管理
                    </a>
                    <a href="{% url 'custom_admin:permission_list' %}" class="btn btn-secondary">
                        <i class="fas fa-user-lock me-1"></i>权限管理
                    </a>
                    <a href="{% url 'custom_admin:article_review_list' %}" class="btn btn-info">
                        <i class="fas fa-check-circle me-1"></i>文章审核
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}